#pragma once

#include <QtWidgets/QMainWindow>
#include <qgraphicsview.h>
#include <qgraphicsitem.h>

class Item : public QGraphicsItem
{
public:
    enum {Type = UserType + 9};
    static bool ReadyGeometryChange;
protected:
    virtual QRectF boundingRect() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
        QWidget *widget) override;
    int type() const { return Type; }

};

class QGraphicsScene;
class View : public QGraphicsView
{
public:
    View(QGraphicsScene *scene, QWidget *parent = nullptr);

protected:

    void mousePressEvent(QMouseEvent *event);
    void wheelEvent(QWheelEvent *event);

private:
    QGraphicsScene *scene_;
};
